/**
 * Created with Intellij IDEA.
 * Description;
 * User:墨琦
 * Data:2023-03-19
 * Time:16:15
 */

class Animal
{
    String name;
    int age;
    Animal(String name, int age)
    {
        this.age=age;
        this.name=name;
    }
    public void Sleep()
    {
        System.out.println(name+"睡着了");
    }
}
class Cat extends Animal{
    Cat(String name, int age) {
        super(name, age);
    }
    public void Action()
    {
        super.Sleep();
        System.out.println("喵喵叫");
    }
}
class Dog extends Animal{
    Dog(String name, int age) {
        super(name, age);
    }
    public void Action()
    {
        super.Sleep();
        System.out.println("汪汪叫");
    }
}
public class Text {
    public static void main(String[] args) {
        Dog fw=new Dog("旺财",5);
        fw.Action();
        Cat fw1=new Cat("星猫",4);
        fw1.Action();
        System.out.println("-------------------------------");
        Animal ww=new Cat("嗷呜",6);
        
    }
}